﻿@using TaskoMask.BuildingBlocks.Contracts.Dtos.Boards
@using TaskoMask.BuildingBlocks.Contracts.Dtos.Cards

<nav aria-label="breadcrumb">
    <ol class="breadcrumb justify-content-start p-3" id="board-breadcrumb">
        <li class="text-nowrap breadcrumb-item">
            <i class="bi bi-building"></i>
            <a href="@("/#"+Model.OrganizationId)">
                @Model.OrganizationName
            </a>
        </li>
        <li class="text-nowrap breadcrumb-item">
            <i class="bi bi-kanban"></i>
            <a href="@("/project/"+Model.ProjectId)">
                @Model.ProjectName
            </a>
        </li>
        <li class="text-nowrap breadcrumb-item">
            <i class="bi bi-clipboard-plus"></i>
            <a href="@("/board/"+Model.Id)">
                @Model.Name
            </a>
        </li>
        <li class="text-nowrap breadcrumb-item active" aria-current="page">
            <a @onclick="@(()=>ShowAddCardModal(Model.Id))" class="text-info">
                <i class="bi bi-plus-circle"></i>
                add a card
            </a>
        </li>
    </ol>
</nav>


@code {
    [Parameter]
    public GetBoardDto Model { get; set; }


    /// <summary>
    ///
    /// </summary>
    private void ShowAddCardModal(string boardId)
    {
        var parameters = new ModalParameters();
        parameters.Add(nameof(Pages.Cards.Components.AddCard.BoardId), boardId);
        ModalService.Show<Pages.Cards.Components.AddCard>("Add Card", parameters, new ModalOptions { Class="blazored-modal w-75 w-md-50 bg-light-gray"});
    }
}
